package com.zzz.java8;

import cn.hutool.core.lang.func.Func;

import javax.lang.model.element.NestingKind;
import java.util.function.Function;

/**
 * @author zhuzhizun
 * @date 2021/8/11
 */
public class Letter {

    public static String addHead(String text) {
        return  text+"------head";
    }

    public static String addTail(String text) {
        return  text+"------tail";
    }

    public static String addBody(String text) {
        return  text+"------body";
    }

    public static void main(String[] args) {
        Function<String,String> addHead = Letter::addHead;
        Function<String,String> addTail = Letter::addTail;
        Function<String,String> combination = addHead.compose(addTail);

        System.out.println(combination.apply("dog"));

    }

}
